home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / gapdr.zip / GAPQBDR.BI < prev    next >
Text File  |  1989-01-18  |  17KB  |  338 lines

  1. '
  2. '  Copyright (C) 1988,1989 The GAP Development Company
  3. '
  4. '  All Rights Reserved
  5. '
  6. '
  7. '  GAPQBDR.BI
  8. '
  9. '  Include file for all modules that use GAPQBDR
  10. '
  11. '
  12.  
  13. DECLARE FUNCTION keybrd% ()               ' public ASM function
  14. DECLARE FUNCTION read.doorsys% ()         ' reads door.sys
  15. DECLARE FUNCTION open.gap% ()             ' reads gapbbs.cnf
  16. DECLARE FUNCTION ckeypress% ()            ' checks for a key press
  17. DECLARE FUNCTION getakey% ()              ' gets a single character
  18. DECLARE FUNCTION a.ccess% (a$)            ' checks for file existence
  19. DECLARE FUNCTION right.trim$ (a$)         ' trims C strings
  20. DECLARE FUNCTION read.gapdos% ()          ' reads GAPDOS.DAT
  21. DECLARE FUNCTION write.gapdos% ()         ' writes GAPDOS.DAT
  22. DECLARE FUNCTION read.gapuser% ()         ' reads USERS.DAT
  23. DECLARE FUNCTION write.gapuser% ()        ' writes USERS.DAT
  24. DECLARE FUNCTION read.pcbsys% ()          ' reads PCBOARD.SYS
  25. DECLARE FUNCTION write.pcbsys% ()         ' writes PCBOARD.SYS
  26. DECLARE FUNCTION read.pcbuser% ()         ' read pcb USERS
  27. DECLARE FUNCTION write.pcbuser% ()        ' write pcb USERS
  28. DECLARE FUNCTION getrand% (low%, high%)   ' get a random number
  29.  
  30. DECLARE SUB init.time ()                  ' inits get.time variables
  31. DECLARE SUB no.carrier ()                 ' shows message and calls leave
  32. DECLARE SUB get.string (fld$)             ' main imput routine
  33. DECLARE SUB read.cnf (f.name$)            ' reads the configuration file
  34. DECLARE SUB init.door ()                  ' initializes the door
  35. DECLARE SUB leave ()                      ' normal exit 
  36. DECLARE SUB show.mess (message$, bell%, newline%)  ' displays a string
  37. DECLARE SUB nl (how%)                     ' sends CR/LF
  38. DECLARE SUB ansi (ansicolor$)             ' shows ansi colors
  39. DECLARE SUB more ()                       ' checks for full screen
  40. DECLARE SUB pause ()                      ' waits for a keypress
  41. DECLARE SUB elap.time ()                  ' computes elapsed time
  42. DECLARE SUB backspace (num.times%)        ' erases characters
  43. DECLARE SUB time.left ()                  ' computes time left
  44. DECLARE SUB waitasec (secs%)              ' waits for x number of seconds
  45. DECLARE SUB time.credit (how%)            ' computes time credits
  46. DECLARE SUB putachar (c%)                 ' sends a single character
  47. DECLARE SUB show.file (filename$)         ' displays a text file
  48. DECLARE SUB set.status (update%)          ' displays status line
  49. DECLARE SUB update.clock ()               ' updates status line clock
  50. DECLARE SUB putkey (c%)                   ' sends a single character
  51. DECLARE SUB do.chat ()                    ' chat with caller
  52. DECLARE SUB pagesysop ()                  ' page sysop for chat
  53. DECLARE SUB clear.scr ()                  ' clears local and remote screen
  54.  
  55.  
  56. ' source code not provided for following functions
  57.  
  58. DECLARE FUNCTION get.time& ()             ' returns time as long integer
  59. DECLARE FUNCTION getkeyc% ()              ' ket a key from local console
  60. DECLARE SUB outstr (ansistr$, row%, col%) ' print strings thru DOS
  61. DECLARE FUNCTION getanum& ()              ' used internally by getrand
  62. DECLARE SUB init.rand ()                  ' used internally by init.door
  63. DECLARE FUNCTION get.directory$ ()        ' get current drive and path
  64. DECLARE SUB set.directory (drive$)        ' sets the default drive and path
  65. DECLARE SUB wrap.word ()                  ' wraps words during sysop chat
  66.  
  67.  
  68. CONST MOREG = "MORE - [Y]es, [N]o, [C]ontinous "
  69. CONST MOREA = "MORE - [Y]es, [N]o, [C]ontinous "
  70.  
  71. CONST MORE1G = "MORE - [Y]es, [N]o, [C]ontinous, [R]edisplay "
  72. CONST MORE1A = "MORE - [Y]es, [N]o, [C]ontinous, [R]edisplay "
  73.  
  74. CONST PAUSEG = "Press [Any Key] To Continue "
  75. CONST PAUSEA = "Press [Any Key] To Continue "
  76.  
  77. CONST YES = 1
  78. CONST NO = 0
  79.  
  80. ' dim colors
  81.  
  82. CONST BLACK = ""
  83. CONST RED = ""
  84. CONST GREEN = ""
  85. CONST BROWN = ""
  86. CONST BLUE = ""
  87. CONST MAGENTA = ""
  88. CONST CYAN = ""
  89. CONST WHITE = ""
  90.  
  91. 'bright colors
  92.  
  93. CONST BBLACK = ""
  94. CONST BRED = ""
  95. CONST BGREEN = ""
  96. CONST YELLOW = ""
  97. CONST BBLUE = ""
  98. CONST BMAGENTA = ""
  99. CONST BCYAN = ""
  100. CONST BWHITE = ""
  101.  
  102.  
  103.  
  104.    '***********************************************************************
  105.    '*  Common variables shared with other modules.                        *
  106.    '*  Not for programmer's use!                                          *
  107.    '*  Do NOT change the order of these common blocks!                    *
  108.    '***********************************************************************
  109.  
  110.    COMMON SHARED /GAPQBDR/ l.ocal  AS INTEGER   ' l.ocal user flag
  111.    COMMON SHARED /GAPQBDR/ lines   AS INTEGER   ' # of lines currently displayed
  112.    COMMON SHARED /GAPQBDR/ flag    AS INTEGER   ' flag that a space was pressed
  113.    COMMON SHARED /GAPQBDR/ column  AS INTEGER   ' column we are at now
  114.    COMMON SHARED /GAPQBDR/ l.ine   AS STRING    ' temporarily hold characters
  115.    COMMON SHARED /GAPQBDR/ CRLF    AS STRING    ' carriage return and line feed
  116.  
  117.  
  118. '$INCLUDE: 'qb.bi'
  119.  
  120.  
  121.    '***********************************************************************
  122.    '*  Variables initialized by reading DOOR.SYS (or pcboard.sys)         *
  123.    '***********************************************************************
  124.  
  125.    COMMON SHARED port      AS INTEGER
  126.    COMMON SHARED userbaud  AS INTEGER
  127.    COMMON SHARED parity    AS INTEGER
  128.    COMMON SHARED node      AS INTEGER
  129.    COMMON SHARED baud      AS INTEGER
  130.    COMMON SHARED s.creen   AS INTEGER
  131.    COMMON SHARED printer   AS INTEGER
  132.    COMMON SHARED bell      AS INTEGER
  133.    COMMON SHARED alarm     AS INTEGER
  134.    COMMON SHARED level     AS INTEGER
  135.    COMMON SHARED minsleft  AS INTEGER
  136.    COMMON SHARED c.olor    AS INTEGER
  137.    COMMON SHARED page      AS INTEGER
  138.    COMMON SHARED expert    AS INTEGER
  139.  
  140.    COMMON SHARED timeson   AS LONG
  141.    COMMON SHARED recnum    AS LONG
  142.    COMMON SHARED uploads   AS LONG
  143.    COMMON SHARED downloads AS LONG
  144.    COMMON SHARED upbytes   AS LONG
  145.    COMMON SHARED downbytes AS LONG
  146.    COMMON SHARED maxbytes  AS LONG
  147.  
  148.    COMMON SHARED username  AS STRING
  149.    COMMON SHARED first     AS STRING
  150.    COMMON SHARED last      AS STRING
  151.    COMMON SHARED city      AS STRING
  152.    COMMON SHARED hphone    AS STRING
  153.    COMMON SHARED bphone    AS STRING
  154.    COMMON SHARED password  AS STRING
  155.    COMMON SHARED lastdate  AS STRING
  156.    COMMON SHARED subscrip  AS STRING
  157.  
  158.    '***********************************************************************
  159.    '*  global variables                                                   *
  160.    '***********************************************************************
  161.  
  162.    COMMON SHARED noup       AS INTEGER     ' if 1, get.string wont upper case
  163.    COMMON SHARED do.pcb     AS INTEGER     ' if 1, then BBS system is pcboard
  164.    COMMON SHARED timeleft   AS INTEGER     ' time user has left
  165.    COMMON SHARED timecredit AS INTEGER     ' time credits for user (in mins)
  166.  
  167.    COMMON SHARED anystring1 AS STRING      ' global garbage collector
  168.    COMMON SHARED maindir    AS STRING      ' path to the main directory
  169.    COMMON SHARED gendir     AS STRING      ' path to the gen directory
  170.    COMMON SHARED sysname    AS STRING      ' sysop's name
  171.    COMMON SHARED bbs.dir    AS STRING      ' path to BBS default dir
  172.    COMMON SHARED board.name AS STRING      ' name of the BBS
  173.  
  174.    COMMON SHARED temptime   AS LONG        ' for calculating time out
  175.    COMMON SHARED timenow    AS LONG        ' time it is now  (in secs)
  176.    COMMON SHARED starttime  AS LONG        ' time the user started (in secs)
  177.  
  178.  
  179.    '***********************************************************************
  180.    '*  GAPDOS.DAT record structure.                                       *
  181.    '*  For those who wish to read, modify, and update the record.         *
  182.    '***********************************************************************
  183.  
  184.    TYPE GAPDOSREC
  185.       userfirst   AS STRING * 16